import { Key } from "react";
import { request } from "@utils/http";
import {IhospitalSetRes,IAddHos,IhospitalSetItem} from "./modal/hospitalsetType";
export function reqHospitalSet(page:number ,limit:number,hosname?:string,hoscode?:string){
    return request.get<any, IhospitalSetRes>(`/admin/hosp/hospitalSet/${page}/${limit}`,{
        params:{
            hosname,
            hoscode,
        }
    })
}

//添加和修改数据
export function reqAddHospitalSet(data: IAddHos) {
    return request.post<any, null>(`/admin/hosp/hospitalSet/save`, data)
  }

  //获取一条医院数据
  export function reqGetOneHospitalSet(id:string) {
    return request.get<any, IhospitalSetItem>(`/admin/hosp/hospitalSet/get/${id}`)
  }

  //修改数据
  export function reqEditOneHospitalSet(data: IhospitalSetItem) {
    return request.put<any, null>(`/admin/hosp/hospitalSet/update`, data)
  }

  //删除数据
  export function reqDelOneHospitalSet(id:string) {
    return request.delete<any, null>(`/admin/hosp/hospitalSet/remove/${id}`)
  }

  //批量删除数据
  export const reqDelAll =(ids:Key[]) =>{request.delete<any,null>(`/admin/hosp/hospitalSet/batchRemove`,{
    data:ids
  })}




